from ask.models import Answer, Question
from django.contrib import admin

class QuestionInline(admin.TabularInline):
#    form = SampleForm
    model = Answer
    extra = 0
    
class QuestionAdmin(admin.ModelAdmin):

    actions = ['make_visible','make_invisible']
    inlines = [QuestionInline]
    list_display=['title', 'status','pub_date']
#    model_admin_manager = Question.private

    def make_visible(self, request, queryset):
        queryset.update(status=1)
    make_visible.short_description = "Make selected visible"

    def make_invisible(self, request, queryset):
        queryset.update(status=0)
    make_invisible.short_description = "Make selected invisible"

admin.site.register(Question, QuestionAdmin)
